/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.service;

import org.springblade.modules.repair.entity.MaintainMalfunctionLog;
import org.springblade.modules.repair.vo.MaintainMalfunctionLogVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.repair.vo.WorkTrackVO;

import java.util.List;

/**
 * 故障维修记录 服务类
 *
 * @author BladeX
 * @since 2021-05-21
 */
public interface IMaintainMalfunctionLogService extends BaseService<MaintainMalfunctionLog> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param maintainMalfunctionLog
	 * @return
	 */
	IPage<MaintainMalfunctionLogVO> selectMaintainMalfunctionLogPage(IPage<MaintainMalfunctionLogVO> page, MaintainMalfunctionLogVO maintainMalfunctionLog);

	/**
	 * 插入工单记录
	 * @param planId 工单id
	 * @param typeName 状态描述
	 * @param planStatus 当前工单状态
	 */
	void insertWorkLog(Long planId, String typeName, Integer planStatus);

	/**
	 * 插入工单记录
	 * @param planId 工单id
	 * @param typeName 状态描述
	 * @param planStatus 当前工单状态
	 * @param ext 额外数据（json)
	 */
	void insertWorkLog(Long planId, String typeName, Integer planStatus, String ext);

	/**
	 * 插入工单记录
	 * @param planId 工单id
	 * @param typeName 状态描述
	 * @param planStatus 当前工单状态
	 * @param ext 额外数据（json)
	 * @param tenantId 对应租户id
	 */
	void insertWorkLog(Long planId, String typeName, int planStatus, String ext, String tenantId);

	/**
	 * 插入工单记录
	 * @param planId 工单id
	 * @param typeName 状态描述
	 * @param planStatus 当前工单状态
	 * @param ext 额外数据（json)
	 * @param executorId 执行人id
	 * @param executor 执行人姓名
	 */
	void insertWorkLog(Long planId, String typeName, Integer planStatus, String ext, Long executorId, String executor);

	/**
	 * 插入工单记录
	 * @param planId 工单id
	 * @param typeName 状态描述
	 * @param planStatus 当前工单状态
	 * @param ext 额外数据（json)
	 * @param executorId 执行人id
	 * @param executor 执行人姓名
	 * @param userNames
	 */
	void insertWorkLog(Long planId, String typeName, Integer planStatus, String ext, Long executorId, String executor, String userNames);

	List<MaintainMalfunctionLog> listByPlanId(Long planId);
	/**
	 * 任务追踪记录
	 * @param planId
	 * @return
	 */
	WorkTrackVO selectWorkTracks(Long planId);

}
